package com.remoting.api.registry.bean;

import org.apache.commons.lang3.StringUtils;

/**
 * 主机信息
 * <p>说明:</p>
 * <li></li>
 * @author DuanYong
 * @since 2016年5月19日上午9:50:52
 */
public class HostInfo {
	/**accessToken KEY*/
	public static final String ACCESS_TOKEN_KEY = "accessToken";
	/**模式KEY KEY*/
	public static final String LIVEMODE_KEY = "livemode";
	/**应用的唯一标示 KEY*/
	public static final String APP_KEY = "appKey";
	/**应用的唯一标示 KEY*/
	public static final String SECRET_KEY = "secretKey";
	/**地址*/
	private String address;
	/**端口*/
	private String port = "80";
	/**应用的唯一标示*/
	private String appKey;
	/**安全码*/
	private String secretKey;
	/**模式*/
	private String livemode;
	/**作用域*/
	private String scope;
	

	public HostInfo(String address, String port,String appKey, String secretKey, String livemode, String scope) {
		this.address = address;
		this.port = port;
		this.appKey = appKey;
		this.secretKey = secretKey;
		this.livemode = livemode;
		this.scope = scope;
	}
	
	public String toUrl() {
		if(StringUtils.isNotBlank(port)){
			return"//" + address + ":" + port;
		}
		return "//" + address ;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getAppKey() {
		return appKey;
	}

	public void setAppKey(String appKey) {
		this.appKey = appKey;
	}

	public String getSecretKey() {
		return secretKey;
	}

	public void setSecretKey(String secretKey) {
		this.secretKey = secretKey;
	}

	public String getLivemode() {
		return livemode;
	}

	public void setLivemode(String livemode) {
		this.livemode = livemode;
	}

	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}
	
}
